package com.fjec.market.controller;

import com.fjec.market.service.IInfoMarketService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@RequestMapping("/")
public class SessionController {

    @Resource
    private IInfoMarketService infoMarketService;

    @GetMapping("/getSessionInfo")
    public Map<String, Object> getSessionInfo(Long userId, int busiType) {
        return infoMarketService.getSessionInfo(userId, busiType);
    }

    /**
     * 根据userId获取用户名称及头像等信息
     *
     * @param userId
     * @return
     */
    @GetMapping("/get/sessionInfo/by/userId")
    public Map<String, Object> getSessionInfoByUserId(@RequestParam("userId") Long userId) {
        return infoMarketService.getSessionInfoByUserId(userId);
    }
}
